import Vue from 'vue'
import Vuex from 'vuex'
import{getItem,setItem}from '@/utils/user.js'

Vue.use(Vuex)

const TOKEY_KEY = 'toutiao_touken'
export default new Vuex.Store({
  state: {
    user:getItem(TOKEY_KEY)
  },
  mutations: {
    setUser(state,payload){
      state.user = payload
      setItem(TOKEY_KEY,payload)
    }
  },
  actions: {
  },
  modules: {
  }
})
